<!DOCTYPE HTML>
<html lang="en">

<head>
    <title>Home</title>
    <!-- Meta tag Keywords -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8"/>
    <meta name="keywords" content=""
    />
    <script src="js/axios.min.js"></script>
    <script src="js/query.js"></script>

    <script>
        addEventListener("load", function () {
            setTimeout(hideURLbar, 0);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        }
    </script>
    <script>
        function login(){
            axios.get("/user/login", {
                params: {
                    userName: $n("userName").value,
                    passWord: $n("passWord").value
                }
            }).then(resp => {
                // alert($n("userName").value);
                // alert($n("passWord").value);
                var info = resp.data;
                if (info == "OK") {
                    location.href = "/index.html";
                }
                else {
                    alert("用户名或密码错误，请重新登录");
                    location.href = "/login.html";
                }
            })
        }
    </script>


    <!-- Meta tag Keywords -->
    <!-- css files -->
    <!-- //copyright -->
    <link rel="stylesheet" href="css/style.css" type="text/css" media="all"/>
    <!-- Style-CSS -->
    <link rel="stylesheet" href="css/fontawesome-all.css">
    <!-- Font-Awesome-Icons-CSS -->
    <!-- //css files -->
    <!-- web-fonts -->
    <!-- //web-fonts -->
</head>

<body>
<!-- bg effect -->
<div id="bg">
    <canvas></canvas>
    <canvas></canvas>
    <canvas></canvas>
</div>
<!-- //bg effect -->
<!-- title -->
<h1>宿舍管理系统</h1>
<!-- //title -->
<!-- content -->
<div class="sub-main-w3">
    <form>
        <h2>Login Now
            <i class="fas fa-level-down-alt"></i>
        </h2>
        <div class="form-style-agile">
            <label>
                <i class="fas fa-user"></i>
                用户名
            </label>
            <input id="userName" name="userName" type="text" required="" ta>
        </div>
        <div class="form-style-agile">
            <label>
                <i class="fas fa-unlock-alt"></i>
                密码
            </label>
            <input id="passWord" name="passWord" type="password" required="">
        </div>
        <!-- checkbox -->
        <!-- //checkbox -->
        <input type="button" value="登 录" onclick="login()">
    </form>
</div>
<!-- //content -->

<!-- copyright -->


<!-- Jquery -->

<!-- //effect js -->
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/canva_moving_effect.js"></script>
</body>

</html>